<template>
	<view class="inform">
		<headertop title="意见反馈" str1="oridei" :back1="back1"></headertop>
		<image src="https://huarun123.oss-cn-shenzhen.aliyuncs.com/static/Rectangle 21541@2x.png" class="inform_back"
			mode=""></image>
		<view class="contents">
			<view class="msgicon" v-if="!list.length">
				<image src="/static/微信图片_20250508155422.png" mode="widthFix"></image>
				<view class="msgtext">
					暂无反馈结果
				</view>
			</view>
			<view class="contents_items" v-for="(item,index) in list" :key="index" v-if="list.length">
				<view class="contents_items_venter">
					<view class="contents_items_venter_top">
						<view class="contents_items_venter_top_btn">
							{{item.type}}
						</view>
						<view class="contents_items_venter_top_t1">
							提交时间：{{timestampfun(item.createtime*1000)}}
						</view>
					</view>
					<view class="contents_items_venter_bottom">
						<view class="contents_items_venter_bottom_t1">
							{{item.title}}
						</view>
						<view class="contents_items_venter_bottom_t2">
							{{item.content}}
						</view>
						<view class="contents_items_venter_bottom_t2" style="margin-top: 30rpx;" v-if="item.status==1">
							<span style="color: #1D2129;font-weight: bold;">官方回复：</span><span
								style="color: #1D2129;">{{item.remark||''}}</span>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="" style="height: 200rpx;">

		</view>
		<view class="fixedbox">
			<view class="btn" @click="gopage">
				我要反馈
			</view>
		</view>
	</view>
</template>

<script>
	import {
		yijianlog
	} from '@/common/api/api.js'
	import headertop from '@/components/header.vue'
	export default {
		components: {
			headertop
		},
		data() {
			return {
				back1: 0,
				list: [],
				lastpage: 0,
				query: {
					page: 1,
					limit: 10
				},
			}
		},
		onShow() {
			this.query.page = 1
			this.list = []
			this.initlist()
		},
		onPageScroll(e) {
			console.log(e, 'eeeeeeeeeeeeeee');
			if (e.scrollTop > 100) {
				this.back1 = '#A2AEFF'
			} else {
				this.back1 = ''
			}
			if (this.query.page < this.lastpage) {
				this.query.page++
				this.initlist()
			}
		},
		methods: {
			timestampfun(time) {
				const date = new Date(time);
				const year = date.getFullYear();
				const month = String(date.getMonth() + 1).padStart(2, "0");
				const day = String(date.getDate()).padStart(2, "0");
				const hours = String(date.getHours()).padStart(2, "0");
				const minutes = String(date.getMinutes()).padStart(2, "0");
				const seconds = String(date.getSeconds()).padStart(2, "0");
				const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`;
				return formattedDate
			},
			async initlist() {
				const res = await yijianlog(this.query)
				if (res.code == 1) {
					this.list.push(...res.data.list)
					this.lastpage = res.data.lastpage
				}
			},
			gopage() {
				uni.navigateTo({
					url: '/pages/my/yijianfankuicreated'
				})
			}
		}
	}
</script>

<style lang="scss">
	.msgicon {
		width: 300rpx;
		margin: 100rpx auto;
		overflow: hidden;

		.msgtext {
			font-size: 45rpx;
			font-weight: bold;
			text-align: center;
			width: 100%;
		}

		image {
			width: 300rpx;
		}
	}

	page {
		background: #F7F8FA;
	}

	.inform {
		width: 100%;
		overflow: hidden;
		position: relative;

		.fixedbox {
			width: 100%;
			overflow: hidden;
			height: 184rpx;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			position: fixed;
			bottom: 0%;

			.btn {
				width: 686rpx;
				height: 88rpx;
				background: #8278FF;
				border-radius: 16rpx;
				text-align: center;
				line-height: 88rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 30rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 88rpx;
				margin: auto;
				margin-top: 22rpx;
			}
		}

		&_back {
			width: 100%;
			height: 278rpx;
			position: absolute;
			z-index: -1;
		}

		.contents {
			overflow: hidden;
			margin: auto;
			margin-top: 196rpx;
			width: 686rpx;

			&_items {
				width: 686rpx;
				// height: 270rpx;
				background: #FFFFFF;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				overflow: hidden;
				margin-bottom: 24rpx;

				&_venter {
					width: 630rpx;
					margin: auto;
					overflow: hidden;

					&_bottom {
						width: 100%;
						overflow: hidden;

						&_t1 {
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							margin-top: 14rpx;
							font-size: 32rpx;
							color: #1D2129;
						}

						&_t2 {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #4E5969;
							// display: -webkit-box;
							// /* 设置为WebKit内核的弹性盒子模型 */
							// -webkit-box-orient: vertical;
							// /* 垂直排列 */
							// -webkit-line-clamp: 2;
							// /* 限制显示三行 */
							// overflow: hidden;
							// /* 隐藏超出范围的内容 */
							// text-overflow: ellipsis;
							// /* 使用省略号 */
							margin-top: 16rpx;
							margin-bottom: 24rpx;
						}
					}

					&_top {
						width: 100%;
						height: 94rpx;
						display: flex;
						align-items: center;

						&_btn {
							width: 128rpx;
							height: 46rpx;
							background: #9FAAFE;
							border-radius: 8rpx 8rpx 8rpx 8rpx;
							text-align: center;
							line-height: 46rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							font-size: 28rpx;
							color: #FFFFFF;
						}

						&_t1 {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #86909C;
							margin-left: 24rpx;
						}
					}
				}
			}
		}





	}
</style>